package ui;

import java.awt.Dialog;
import java.awt.Dimension;
import java.awt.Label;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JPanel;

public class ParticipantDialog extends Dialog
{
	/**
	 * 
	 */
	private static final long serialVersionUID = -819626723024049330L;
	private int participantID = 0;
	private JComboBox participantCombobox;
	private JButton buttonOK;
	
	
	public ParticipantDialog()
	{
		super(MainWindow.getFrame(), "Choose the participant ID", true);
		
		JPanel panel = new JPanel();
		

		this.setSize(new Dimension(300, 100));
		panel.setSize(new Dimension(300, 100));
		
		panel.add(new Label("Participant ID: "));
		
		Integer[] participantsID = new Integer[] {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16};
		this.participantCombobox = new JComboBox<Integer>(participantsID);
		panel.add(this.participantCombobox);
		
		this.buttonOK = new JButton("OK");
		panel.add(buttonOK);
		
		this.buttonOK.addActionListener(new ActionListener()
		{
			@Override
			public void actionPerformed(ActionEvent arg0) {
				// TODO Auto-generated method stub
				MainWindow.loadExperiment((int) participantCombobox.getSelectedItem());
				
				setVisible(false);
			}
			
		});	
		
		this.add(panel);
	}
}
